const Base = require("./base");
module.exports = class ProductTypeService extends Base {
  payType(options) {
    options = this.utils.filterObjectEmpty(options);
    const { fid } = options;
    let exps = fid ? `(id=${fid} OR fid=${fid}) AND` : "";
    let sql = `SELECT * FROM product_pay_type WHERE ${exps} status>0`;
    return this.app.mysql
      .use("foindia")
      .query(sql)
      .then((res) => res[0])
      .then((res) => {
        return this.utils.installTree(res, options);
      });
  }
};
